package com.rainbow.bam.entity;

import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

/**
 * 角色实体类
 * 
 * @author zhaolei
 * @version $Id: HtDuty.java, v 0.1 2015年11月19日 下午5:28:44 zhaolei Exp $
 */
@Entity
@Table(name = "ht_duty")
@NamedQuery(name = "HtDuty.findAll", query = "SELECT c FROM HtDuty c")
public class HtDuty implements java.io.Serializable {

    /**
     * UUID
     */
    private static final long serialVersionUID = -8474025844522178714L;
    /**
     * ID
     */
    @Id
    @GeneratedValue(generator = "identity")
    @GenericGenerator(name = "identity", strategy = "identity")
    @Column(unique = true, nullable = false, name = "duty_id")
    private Long              id;
    /**
     * 状态 A  D
     */
    @Column
    private String            status;

    /**
     * 角色名称
     */
    @Column(name = "duty_name")
    private String name;

    /**
     * 角色描述
     */
    @Column(name = "description")
    private String describe;

    /**
     * 角色类型
     */
    @Column(name = "duty_type")
    private String dutyType;

    /**
     * 关联权限中间表
     */
    @OneToMany(mappedBy = "htDuty", cascade = CascadeType.REMOVE)
    private Set<HtDutyAction> htDutyActions;

    /**
     * 关联用户中间表
     */
    @OneToMany(mappedBy = "htDuty", cascade = CascadeType.ALL)
    private Set<HtAccountDuty> accountDuties;

    public HtDuty() {

    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescribe() {
        return this.describe;
    }

    public void setDescribe(String describe) {
        this.describe = describe;
    }

    public Set<HtDutyAction> getHtDutyActions() {
        return htDutyActions;
    }

    public void setHtDutyActions(Set<HtDutyAction> htDutyActions) {
        this.htDutyActions = htDutyActions;
    }

    public Set<HtAccountDuty> getAccountDuties() {
        return this.accountDuties;
    }

    public void setAccountDuties(Set<HtAccountDuty> fwAccountDuties) {
        this.accountDuties = fwAccountDuties;
    }

    public String getDutyType() {
        return dutyType;
    }

    public void setDutyType(String dutyType) {
        this.dutyType = dutyType;
    }

}
